/*
 * Copyright (c) Huawei Device Co., Ltd. 2023. All rights reserved.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef DLP_PERMISSION_LOAD_CALLBACK_H
#define DLP_PERMISSION_LOAD_CALLBACK_H

#include "system_ability_definition.h"
#include "system_ability_load_callback_stub.h"
#include "se_service.h"

namespace OHOS {
namespace SE {
namespace OMAPI {

class ServiceLoadCallback : public SystemAbilityLoadCallbackStub {
public:
    explicit ServiceLoadCallback(std::weak_ptr<SEService> seService);

    /**
      * OnLoadSystemAbilitySuccess, OnLoadSystemAbilitySuccess will be called when loadsystemability success.
      *
      * @param systemAbilityId, The loaded said.
      * @param remoteObject, Loaded sa object.
      * @return void.
      */
    void OnLoadSystemAbilitySuccess(int32_t systemAbilityId, const sptr<IRemoteObject>& remoteObject);

     /**
      * OnLoadSystemAbilityFail, OnLoadSystemAbilityFail will be called when loadsystemability failed.
      *
      * @param systemAbilityId, The loaded said.
      * @return void.
      */
    void OnLoadSystemAbilityFail(int32_t systemAbilityId);

private:
    // service instance used to do initialize when the sa is loaded.
    std::weak_ptr<SEService> seService_;
};
}  // namespace OMAPI
}  // namespace SE
}  // namespace OHOS
#endif // DLP_PERMISSION_LOAD_CALLBACK_H
